package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsOrderMapper;
import com.qf.mapper.StatMapper;
import com.qf.pojo.DtsOrder;
import com.qf.service.DtsOrderService;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DtsOrderServiceImpl implements DtsOrderService {

    @Autowired
    DtsOrderMapper orderMapper;

    @Autowired
    StatMapper statMapper;


    @Override
    public int getTotal() {
        LambdaQueryWrapper<DtsOrder> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsOrder::getDeleted, false);
        Integer count = orderMapper.selectCount(wrapper);
        return count;
    }

    @Override
    public List<Map<String, Object>> findSellData() {
        return statMapper.findCategorySellData();
    }

    @Override
    public List<DayStatis> findOrderAmts() {
        return statMapper.findOrderAmts();
    }

    @Override
    public List<Map<String, Object>> findCategorySellData() {
        return  statMapper.findCategorySellData();
    }
}
